package com.project.bean;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDate;

public class SpeakBean {
    private int id;
    private String content;
    private UserBean user;
    private ProductBean product;
    @JsonFormat()
    private LocalDate speakDate = LocalDate.now();

    public SpeakBean() {
    }

    public SpeakBean(int userId, int productId,String content) {
        this.content = content;
        this.user = new UserBean();
        this.user.setId(userId);
        this.product = new ProductBean();
        this.product.setId(productId);
    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    public ProductBean getProduct() {
        return product;
    }

    public void setProduct(ProductBean product) {
        this.product = product;
    }

    public LocalDate getSpeakDate() {
        return speakDate;
    }

    public void setSpeakDate(LocalDate speakDate) {
        this.speakDate = speakDate;
    }

    @Override
    public String toString() {
        return "SpeakBean{" +
                "id=" + id +
                ", content='" + content + '\'' +
                ", user=" + user +
                ", product=" + product +
                ", speakDate=" + speakDate +
                '}';
    }
}
